# 定义libmodbus库头文件的路径
HEADERS_DIR := /home/dengxm2024/linuxProgDir/imx280astudy/userside_code/libmodbustest/libmodbus_install/include

# 添加头文件路径到编译器的搜索路径中
CFLAGS += -I$(HEADERS_DIR)


#指定libmodbus库路径及库名称
LDFLAGS += -L$(CURDIR)/libmodbus_install/lib -lmodbus
#LDFLAGS += -L/home/dengxm2024/linuxProgDir/imx280astudy/userside_code/libmodbustest/libmodbus_install/lib -lmodbus

EXEC = $(IMX28_exe_DIR)modbustcpserver
OBJS = bandwidth-server-many-up.o
SRC  = bandwidth-server-many-up.c
# 指定编译器前缀
CC = $(CROSS_COMPILE)gcc

LDFLAGS += 

all:$(EXEC)

$(EXEC):$(OBJS)
	$(CC) $(LDFLAGS) -o $@ $(OBJS) -pthread

%.o:%.c
	$(CC) $(CFLAGS) -c $< -o $@ -pthread
install:
	cp $(EXEC) $(IMX28_exe_DIR)
clean:
	@rm -vf $(EXEC) *.o *~